<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生管理系统-首页</title>
    <!--bootstrap-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://kit.fontawesome.com/edeefb586f.js"></script>
<script src="https://cdn.bootcss.com/fontawesome-iconpicker/3.2.0/js/fontawesome-iconpicker.js"></script>
</head>
<body>
<div class="container">
    <h1 class="info"><a href="/student/index/">学生列表</a></h1>
    <br>
<a href="/student/add/"><button class="btn btn-warning btn-lg float-right">添加学生信息<i class="fas fa-plus"></i></button></a>
    <a href="/student/export_excel"><button>导出学生列表</button></a>
    <form action="/student/fuzzy/" method="post">
        {% csrf_token %}
        姓名：
        <input type="text" name="name">
        性别：
{#        <input type="text" name="gender">#}
        <select name="gender">
            <option value="0">未选择</option>
            <option value="1">男</option>
            <option value="2">女</option>
            <option value="3">保密</option>
        </select>
        年龄：
        <input type="text" name="age">
        <input type="submit" value="提交">

{#        <select>#}
{#            <option value="">{{ student_list.no }}</option>#}
{#        </select>#}
    </form>
<table class="table">
    <tr class="thead-dark">
        <th>#</th>
        <th>学号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
        <th>电话</th>
        <th>头像</th>
        <th>加入时间</th>
        <th>操作</th>
    </tr>
    {% for stu in student_list %}
    <tr>
        <td><input type="checkbox" name="student"></td>
        <td>{{ stu.no }}</td>
        <td>{{ stu.name }}</td>
        <td>{{ stu.age }}</td>
        <td>{{ stu.get_gender_display }}</td>
        <td>{{ stu.phone }}</td>
        <td><img src="/media/{{ stu.avatar }}" width="50px" height="50px"></td>
        <td>{{ stu.join_time | date:"Y-m-d H:i:s"}}</td>
        <td><a href="/student/{{ stu.no }}/update/"><span><i class="fas fa-edit"></i></span></a> <a href="/student/{{ stu.no }}/delete"><span><i class="fas fa-trash-alt"></i></span></a> <a href="/student/select/"><span><i class="far fa-eye"></i></span></a></td>
    </tr>
    {% endfor %}
{#    <tr>#}
{#        <td><input type="checkbox" name="student"></td>#}
{#        <td>0001</td>#}
{#        <td>小明</td>#}
{#        <td>13</td>#}
{#        <td>2</td>#}
{#        <td>13152523511</td>#}
{#        <td><img src="#" width="50px" height="50px"></td>#}
{#        <td><a href="/student/update/"><span><i class="fas fa-edit"></i></span></a> <a href="/student/delete"><span><i class="fas fa-trash-alt"></i></span></a></td>#}
{#    </tr>#}
</table>
<!--分页-->
<nav aria-label="Page navigation">
    <ul class="pagination">
        <li class="page-item"><a class="page-link" href="/student/index/?page_no={{ page_previous }}&page_size=3">上一页</a></li>
        {% for i in page_amount_list %}
            <li {% if forloop.counter == page_no %} class="page-item active" {% else %} class="page-item"{% endif %}>
                <a class="page-link" href="/student/index/?page_no={{ forloop.counter }}&page_size=3">
                    {{ forloop.counter }}</a>
            </li>
        {% endfor %}
        <li class="page-item"><a class="page-link" href="/student/index/?page_no={{ page_next }}&page_size=3">下一页</a></li>
    </ul>
</nav>
</div>
</body>
</html>





<!--分页-->
{#<nav aria-label="Page navigation">#}
{#    <ul class="pagination">#}
{#        <li class="page-item"><a class="page-link" href="/student/index/?page_no={{ page_previous }}&page_size=3">上一页</a></li>#}
{#        {% for i in page_amount_list %}#}
{#            <li {% if forloop.counter == page_no %} class="page-item active" {% else %} class="page-item"{% endif %}>#}
{#                <a class="page-link" href="/student/index/?page_no={{ forloop.counter }}&page_size=3">#}
{#                    {{ forloop.counter }}</a>#}
{#            </li>#}
{#        {% endfor %}#}
{#        <li class="page-item"><a class="page-link" href="/student/index/?page_no={{ page_next }}&page_size=3">下一页</a></li>#}
{#    </ul>#}